<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <title>我的购物车</title> 
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> 
  <meta content="培训课程分类,培训视频,管理培训视频,企业培训视频,网络商学院,英盛网" name="keywords" /> 
  <meta content="英盛网全部视频课程分类,为您提供详细培训课程分类.选培训课程看分类,让您找培训课程更省时,方便." name="description" /> 
  <meta content="英盛网" name="author" /> 
  <!--CSS文件--> 
  <link href="css/global_cart.css" type="text/css" rel="stylesheet" /> 
  <link href="css/global_buy.css" type="text/css" rel="stylesheet" /> 
  <link href="css/buy_cart.css" type="text/css" rel="stylesheet" /> 


  <script type="text/javascript" async="" src="js/adw.js"></script> 
  <script src="js/jquery-1.9.1.min.js" type="text/javascript"></script> 
  <script src="js/layer.min.js" type="text/javascript"></script> 
  <link type="text/css" rel="stylesheet" href="css/layer.css" id="skinlayercss" /> 
  <script charset="utf-8" src="js/onyx-full.js" type="text/javascript"></script> 
  
  <script src="js/jquery.cookie.js" type="text/javascript"></script> 
  <script type="text/javascript">
        
        $(document).ready(function () {

            $("#inChkAll").click(function () {
                $('input:checkbox[name=chb_item]').prop("checked", $(this).prop("checked"));
                $("#aChkAll").prop("checked", $(this).prop("checked"));
                var sum = 0;
             if($("#inChkAll").is(":checked")){
              $(".subChk").prop("checked",true);
              $(".subChk").each(function(){
               var price = parseInt($(this).next().val());
               sum = sum + price;
              })

             }else{
              $(".subChk").prop("checked",false);
              sum=0.00;
             }
             $("#cartTotalMoney").text(sum);
            });

            $("#aChkAll").click(function () {
                $('input:checkbox[name=chb_item]').prop("checked", $(this).prop("checked"));
                $("#inChkAll").prop("checked", $(this).prop("checked"));
            });



        });


        
    </script> 
  <style>
        .buy_box .sub_price .s6 {
            color: #333333;
            font-size: 20px;
            margin-left: 10px;
        }
        .sp_w {
            width:100px;
        }
    </style> 

  <link rel="stylesheet" href="css/blue.css?4.1.7" /> 
  <style>* { margin:0; padding:0;}.global_feedback {width: 530px;display: none;background: #fff;z-index: 999;}.global_feedback table {width: 530px;text-align: center;font-size: 25px;}.global_feedback .h_20 {height: 20px;}.global_feedback table tr {height: 50px;}.global_feedback .t_title {height: 40px;}.global_feedback .tips {height: 30px;color: #ff0000;font-size: 12px;text-align: left;}.global_feedback .t_left {text-align: right;font-size: 14px;}.global_feedback .t_right {text-align: left;font-size: 14px;}.global_feedback .t_right select {height:30px;}.global_feedback .t_right input, .global_feedback textarea {width: 310px;border: 1px solid #dddddd;padding: 10px;height: 14px;border-radius: 3px;}.global_feedback textarea {line-height: 20px;height: 116px;margin-top: 10px;}.global_feedback .sub_btn {background: #288ce6;font-size: 20px;color: #fff;padding: 10px 32px;border-radius: 5px;border: none;cursor: pointer;margin: 20px;}</style> 
 </head> 
 <body> 
  <div style="position: absolute; left: -9999em; top: 177px; display: block; width: auto; z-index: 1987;" class=" aui_state_focus"> 
   <div class="aui_outer"> 
    <table class="aui_border"> 
     <tbody> 
      <tr> 
       <td class="aui_nw"></td> 
       <td class="aui_n"></td> 
       <td class="aui_ne"></td> 
      </tr> 
      <tr> 
       <td class="aui_w"></td> 
       <td class="aui_c"> 
        <div class="aui_inner"> 
         <table class="aui_dialog"> 
          <tbody> 
           <tr> 
            <td class="aui_header" colspan="2"> 
             <div class="aui_titleBar"> 
              <div class="aui_title" style="cursor: move; display: block;">
                消息 
              </div> 
              <a href="javascript:/*artDialog*/;" class="aui_close" style="display: block;">&times;</a> 
             </div></td> 
           </tr> 
           <tr> 
            <td class="aui_icon" style="display: none;"> 
             <div class="aui_iconBg" style="background: transparent none repeat scroll 0% 0%;"></div></td> 
            <td class="aui_main" style="width: auto; height: auto;"> 
             <div class="aui_content" style="padding: 20px 25px;"> 
              <div class="aui_loading"> 
               <span>loading..</span> 
              </div> 
             </div></td> 
           </tr> 
           <tr> 
            <td class="aui_footer" colspan="2"> 
             <div class="aui_buttons" style="display: none;"></div></td> 
           </tr> 
          </tbody> 
         </table> 
        </div></td> 
       <td class="aui_e"></td> 
      </tr> 
      <tr> 
       <td class="aui_sw"></td> 
       <td class="aui_s"></td> 
       <td class="aui_se" style="cursor: se-resize;"></td> 
      </tr> 
     </tbody> 
    </table> 
   </div> 
  </div> 
<!--  <script src="js/YS.SSO.VS.Login.js"></script> -->
  <div style="background-color: rgb(40, 140, 230); height: auto;" id="YingShengSSOTopDIV">
   <div class="global_top" id="yS_tOp_LoGinbaR">
    <ul>
     <li class="top_logo"> <a href="index.html"><img src="images/global_logo.png" alt="英盛网" /></a></li>
     <li class="login _sso" style="display: none;"><a onclick="OpenLoginOrRegBox('f','1')" href="javascript:void(0)" title="登录" rel="nofollow">登录</a></li>
     <li class="reg _sso" style="display: none;"><a onclick="OpenLoginOrRegBox('f','0')" href="javascript:void(0)" title="注册" rel="nofollow">注册</a></li>
     <li style="display: list-item;" class="msg" id="ys_top_Msg"><a class="gradient_all msg_bg" href="javascript:void(0)"><i class="i1"><i class="i2" style="display:none" id="ys_top_haveMsgIcon"></i></i></a>
      <div style="display:none;" class="msg_div">
       <dl>
        <dd>
         <a class="gradient_all" href="#">课程通知<span id="ys_top_msgType_2">0</span></a>
        </dd>
        <dd>
         <a class="gradient_all" href="#">交易通知<span id="ys_top_msgType_3">0</span></a>
        </dd>
        <dd>
         <a class="gradient_all" href="#">我的评论<span id="ys_top_msgType_4">0</span></a>
        </dd>
        <dd>
         <a class="gradient_all" href="#">系统消息<span id="ys_top_msgType_1">0</span></a>
        </dd>
       </dl>
      </div> </li>
     <li class="line"></li>
     <li class="name global_top_LoginInfo" style="display: list-item;"><a id="global_top_UserName" href="javascript:void()" title="用户名" rel="nofollow" th:text="${session.user.username}">adou416148489<i></i><br /><span class="s1">Y币：0</span></a>
      <div style="display: none; " class="member_div">
       <dl>
        <dd>
         <a href="http://i.yingsheng.com/" title="个人中心" target="_blank">个人中心</a>
        </dd>
        <dd>
         <a href="http://order.yingsheng.com/Order?source=1" title="购 物 车" target="_blank">购 物 车</a>
        </dd>
        <dd>
         <a href="http://i.yingsheng.com/courselist-1.html" title="已 购 买" target="_blank">已 购 买</a>
        </dd>
        <dd>
         <a href="http://i.yingsheng.com/collect.html" title="我的收藏" target="_blank">我的收藏</a>
        </dd>
        <dd>
         <a href="http://i.yingsheng.com/orderlist-1.html" title="我的订单" target="_blank">我的订单</a>
        </dd>
        <dd>
         <a href="http://i.yingsheng.com/courseview.html" title="观看历史" target="_blank">观看历史</a>
        </dd>
        <dd>
         <a href="http://zone.yingsheng.com/" title="我的空间" target="_blank" style="display: none; " id="ys_top_dl_dd_LinkZone">我的空间</a>
        </dd>
        <dd>
         <a onclick="return confirm('确认要退出?');" rel="nofollow" href="http://sso.yingsheng.com/logout.aspx?from=http%3a%2f%2fwww.yingsheng.com" title="退出" id="action_logout">退出</a>
        </dd>
       </dl>
      </div> </li>
     <li class="avatar global_top_LoginInfo" style="display: list-item;"> <a target="_blank" href="member_index.html" ><img class="m1" src="images/101925_100_100.jpg?r=0.6502539684544028" alt="头像" id="global_top_UserFace" /></a> <img style="display:none;" class="m2" src="images/vip_ioc.png" alt="vip" /> </li>
     <li class="reg_gift" id="top_btn_RegGift" style="display: none;"><a href="http://www.yingsheng.com/zhuanti-141103.html" title="注册有礼" target="_blank" rel="nofollow">注册有礼</a></li>
     <li class="app_down"><a target="_blank" rel="nofollow" href="http://www.yingsheng.com/app">手机APP</a></li>
    </ul>
   </div>
  </div>
  <div class="clear"></div> 
  <div class="buy_box"> 
   <div class="list_title"> 
    <span></span>购物车 
   </div> 
   <div class="clear"></div> 
   <table cellspacing="0" cellpadding="0" border="0" class="cart_list"> 
    <tbody> 
     <tr> 
      <th style="width: 50px;" class="t1"> <input type="checkbox" id="inChkAll" />全选</th> 
      <th style="width: 380px;">课程名称</th> 
      <th style="width: 94px;">产品类型</th>
      <th style="width: 115px;">价格(元)</th>
      <th style="width: 96px;">操作</th> 
     </tr> 
     <tr id="cart_6756" th:each="cart,stat : ${cartList}">
      <td class="t1"> <input type="checkbox" attr-itemid="1413" attr-val="6756" data-type="A" data-title="软文营销如何创造8亿营销奇迹（10集）" name="chb_item" class="subChk" /><input type="hidden" th:value="${cart.course.price}"></td>
      <td class="t2"> <img width="60" height="48" th:src="${cart.course.cover}" />
       <div> 
        <a target="_blank" href="#"> <span class="name" th:text="${cart.course.courseName}">软文营销如何创造8亿营销奇迹（10集）</span></a>
        <span class="s1">课程</span> 
       </div> </td> 
      <td class="t3"> 视频 </td> 

      <td class="t4" th:text="${cart.course.price}">68</td>

      <td class="t5"><a class="del" attr-type="A" attr-itemid="1413" attr-val="6756" href="javascript:" th:onclick="'del(' + ${session.user.id} + ',' + ${cart.course.id} + ')'">删除</a></td>
     </tr> 
     <tr> 
      <td style="height: 10px; padding: 0;"></td> 
     </tr> 
     <tr> 
      <td class="bottom" colspan="7"><a id="clearcart" href="javascript:void(0)" th:onclick="'delAll()'">清空购物车</a> <span style="text-align: right; padding-right: 20px;">购物车数量总计：<samp id="cartItemCount" th:text="${count}">2</samp>件</span> </td>
     </tr> 
    </tbody> 
   </table> 
   <div class="clear"></div> 
   <div class="sub_price"> 
    <ul> 
     <li> <span class="sp_w">应付</span><span class="s1">&yen;</span><span class="s1" id="cartTotalMoney">111</span><br /> <span style="display: none;" class="s2">*请填写您的手机号码，以便我们为您提供更优质的服务： <input type="text" maxlength="14" value="" class="phone" id="mobile" /></span> </li>
    </ul> 
    <dl> 
     <a th:href="@{/course}">继续选购课程</a>
     <a id="btnGoPay" class="settlement" href="javascript:void(0);" th:data-uid="${session.user.id}" th:data-list="${cartList}" th:onclick="'pay()'">前去结算</a>
    </dl> 
   </div> 
   <div class="clear"></div> 
   <input type="hidden" value="True" id="isexpire" /> 
  </div> 
  <div class="clear"></div> 
  <div class="buy_foot"> 
   <ul> 
    <li> <a target="_blank" href="index.html">英盛网首页</a>| <a target="_blank" href="http://i.yingsheng.com/">个人中心</a>| <a target="_blank" href="http://ask.yingsheng.com/">问问题</a>| <a target="_blank" href="http://zone.yingsheng.com/">找老师</a>| <a target="_blank" href="course.html">找课程</a>| <a target="_blank" href="classes.html">岗位系统班</a> </li> 
   </ul> 
   <div class="certification"> 
    <a rel="nofollow" style="display: inline-block;" kx_type="图标式" tabindex="-1" id="kx_verify" href="http://www.yingsheng.com/link.htm?linkurl=https://ss.knet.cn/verifyseal.dll?sn=e14111144030056156pfd9000000&amp;ct=df&amp;a=1&amp;pa=0.5873584735672921" title="经营性网站备案信息" target="_blank"> <img src="images/certification_1.png" alt="安全联盟" /></a> 
    <img src="images/certification_2.png" alt="支付宝" /> 
    <img src="images/certification_3.png" alt="网络警察" /> 
    <a href="http://www.yingsheng.com/link.htm?linkurl=http://www.baidu.com/s?wd=www.yingsheng.com%40v&amp;tn=baidu&amp;ie=utf-8&amp;bs=www.xsteach.com%40v&amp;f=8&amp;rsv_bp=1&amp;rsv_sug3=13&amp;rsv_sug4=767&amp;rsv_sug1=1&amp;rsv_sug2=0&amp;inputT=4221&amp;rsv_sug=1&amp;qh=360" title="百度信誉" target="_blank" rel="nofollow"> <img src="images/certification_4.png" alt="百度信誉" /></a> 
    <img src="images/certification_5.png" alt="经营性网站备案信息" /> 
    <script src="http://kxlogo.knet.cn/seallogo.dll?sn=e14111144030056156pfd9000000&amp;size=0"></script> 
    <span style="display:inline-block;position:relative;width:auto;"><a style="display:inline-block;" kx_type="图标式" target="_blank" tabindex="-1" id="kx_verify" href="https://ss.knet.cn/verifyseal.dll?sn=e0505194400000224489546357&amp;ct=df&amp;a=1&amp;pa=0.3431632444121253"><img alt="可信网站" oncontextmenu="return false;" style="border:none;" src="images/yx_2.png" /></a></span> 
   </div> 
   <p> 版权所有：英盛网 网站备案号：粤ICP备050222448&nbsp;&nbsp;&nbsp;&nbsp;经营许可证：粤B2-20130302<br /> Copyright 2011 Enterprise Management Training<br /> Center All Rights Reserved ｜ </p> 
  </div> 
  <!--** 右边悬浮 *****--> 
  <div class="fd_float"> 
   <div class="fd_box"> 
    <a target="_blank" href="http://www.yingsheng.com/app" class="fd_a fd_app" title="英盛APP下载" rel="nofollow"> <span class="fd_ck"><span class="fk_ckcont"> <img alt="英盛APP下载" src="images/code.png" /></span></span> </a> 
    <a class="fd_a fd_qq" href="http://wpa.qq.com/msgrd?v=3&amp;uin=475855150&amp;site=qq&amp;menu=yes" target="_blank" title="客服" rel="nofollow"></a> 
    <a href="http://order.yingsheng.com/Order?source=1" class="fd_car" target="_blank" title="购物车" rel="nofollow"></a> 
    <script src="js/feedback.js" type="text/javascript"></script> 
    <a href="javascript:;" class="fd_feedback" title="反馈" id="fd_feedback" rel="nofollow"></a> 
    <a id="J_Feedback" href="javascript:;" class="fd_a fd_totop" title="返回页首" rel="nofollow"></a> 
   </div> 
  </div> 
  <script type="text/javascript">
        var hasCard = false;
    </script> 
  <div class="global_feedback" id="ys_global_feedbackBox"> 
   <table> 
    <tbody> 
     <tr class="h_20"> 
      <td colspan="2"></td> 
     </tr> 
     <tr class="t_title"> 
      <td colspan="2">用户反馈</td> 
     </tr> 
     <tr> 
      <td width="130px" class="t_left">分类：</td> 
      <td width="*" class="t_right"><select id="fq_text_cate"></select></td> 
     </tr> 
     <tr> 
      <td class="t_left">标题：</td> 
      <td class="t_right"><input type="text" id="fq_text_title" /></td> 
     </tr> 
     <tr> 
      <td class="t_left">联系人：</td> 
      <td class="t_right"><input type="text" id="fq_text_linkname" /></td> 
     </tr> 
     <tr> 
      <td class="t_left">联系邮箱：</td> 
      <td class="t_right"><input type="text" id="fq_text_email" /></td> 
     </tr> 
     <tr> 
      <td class="t_left">手机号码：</td> 
      <td class="t_right"><input type="text" id="fq_text_tel" /></td> 
     </tr> 
     <tr> 
      <td class="t_left">联系QQ：</td> 
      <td class="t_right"><input type="text" id="fq_text_qq" /></td> 
     </tr> 
     <tr> 
      <td class="t_left">反馈内容：</td> 
      <td class="t_right"><textarea id="fq_text_context"></textarea></td> 
     </tr> 
     <tr> 
      <td colspan="2"><input type="button" value="提交" class="sub_btn" id="sub_feedback" /></td> 
     </tr> 
    </tbody> 
   </table> 
  </div> 
  <div style="display: none; position: fixed; left: 0px; top: 0px; width: 100%; height: 100%; cursor: move; opacity: 0; background: rgb(255, 255, 255) none repeat scroll 0% 0%;"></div>  
 <div style="text-align: center; position: fixed; bottom: 0; width: 100%; line-height: 150%; background: #f5f5f5; border-top: 1px solid #ddd;">本素材由源代码设计店铺收集整理，<a style="color:blue" target="_blank" href="https://item.taobao.com/item.htm?spm=2013.1.0.0.db8f67ddfNU55&amp;id=564028312196">点此购买合集</a>
	</div>
 <script>
  $(function(){
   //计算总价
   var sum = 0;
      $("#inChkAll").attr("checked", true);
      $(".subChk").attr("checked", true);
   $(".subChk").each(function(){
    var price = parseInt($(this).next().val());
    sum = sum + price;
   })
   $("#cartTotalMoney").text(sum);

   $(".subChk").click(function (){
    $("#inChkAll").attr("checked", false);
    var sum = parseInt($("#cartTotalMoney").text());
    if ($(this).is(":checked")) {
     var price = parseInt($(this).next().val());
     sum = sum + price;
    }else{
     var price = parseInt($(this).next().val());
     sum = sum - price;
    }
    $("#cartTotalMoney").text(sum);
   });

  })
 </script>
 <script>
  //删除一条购物车
  function del(uid,courseId){
   $.ajax({
    type:"delete",
    url:"/delCart",
    async:false,
    data:{
     "uid": uid,
     "courseId" : courseId
    },
    success: function(data){
       alert(data);
       window.location.href = "/cart";
    }
   })
  }
//清空购物车
  function delAll(){
   var r = confirm("是否要清空购物车？");
   if(r == true){
    $.ajax({
     type:"delete",
     url:"/delAllCart",
     async:false,
     success: function(data){
      alert(data);
      window.location.href = "/cart";
     }
    })
   }

  }
 </script>
 <script>
  //结算购物车，跳转到订单页面
  function pay(){
   var uid = $("#btnGoPay").attr("data-uid");
   var sumPrice = $("#cartTotalMoney").text();
   console.log(uid);
   console.log(sumPrice);


   $.ajax({
    type:"get",
    url:"/addOrder",
    async:false,
    data:{
     "uid": uid,
     "sumPrice": sumPrice,
    },
    success: function(data){
       if(data != "生成订单失败"){
        console.log(data);
        alert("生成订单成功");
        window.location.href = "/orderdetail?oid=" + data;
       }else{
          alert(data);
       }

    }
   })
  }
 </script>